<template>
  <div class="slot-table">
    <vxe-grid
      max-height="500"
      border
      highlight-hover-row
      @cell-click="cellClickEvent"
      row-class-name="my-row"
      :form-config="$attrs.config.tableForm"
      :data="$attrs.config.tableData"
      :columns="$attrs.config.tableColumn"
      @form-submit="findList"
    >
    </vxe-grid>
  </div>
</template>

<script>

export default {
  data() {
    return {
      loading: false,
    };
  },
  created() {
    this.findList();
  },
  methods: {
    /**
     * 查找表格数据
     */
    async findList() {
      this.$emit("loadata", this.$attrs.config.tableForm.data);
    },

    /**
     * 单击单元格触发
     */
    cellClickEvent() {
      this.$emit("dbcell", arguments[0].row);
    },
  },
};
</script>

<style lang="scss" scoped>
.slot-table {
  ::v-deep .myrow {
    cursor: pointer;
  }
}
</style>
